package com.szholly.plug.cms.entity.comment;

import java.util.HashMap;

import org.springframework.stereotype.Component;

import com.szholly.utils.spring.SpringBeanFactory;
import com.szholly.data.general.*;
import com.szholly.data.general.metadata.IBaseTable;

/**
 * 评论内容表
 */
@Component("cms_comment_ext")
public class CommentExtTable extends InterceptorTableBase  implements IBaseTable{

	public final static String TABLE_NAME = "cms_comment_ext";
	
	/**
	 * single ref
	 */
	public static CommentExtTable getSingleRef() {
		return (CommentExtTable) SpringBeanFactory.getBean("cms_comment_ext");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "评论内容表";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_GUID);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(1);
			itemField.setFieldAliasName("GUID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_VERSION);
			itemField.setDataType(GlobalDataType.Int32);
			itemField.setFieldID(2);
			itemField.setFieldAliasName("VERSION");
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_COMPANY);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(3);
			itemField.setFieldAliasName("COMPANY");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_SYSTEMNAME);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(4);
			itemField.setFieldAliasName("SYSTEMNAME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(CommentExtRow.FIELD_CommentId);
			itemField.setDataType(GlobalDataType.Int32);
			itemField.setFieldID(4);
			itemField.setFieldAliasName("comment_id");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(CommentExtRow.FIELD_Text);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(4);
			itemField.setFieldAliasName("评论内容");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(CommentExtRow.FIELD_Ip);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(4);
			itemField.setFieldAliasName("IP地址");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(CommentExtRow.FIELD_Reply);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(4);
			itemField.setFieldAliasName("回复内容");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "CMS";
	}
}